﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Chinaer.Web
{
    public partial class administratorLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            var result = CommonService.GetChinaerService.LoginAdministratorByNameAndPassword(this.txtName.Text.Trim(), this.txtPassword.Text.Trim());
            if (result.LoginStatus == Chinaer.Core.BaseCore.LoginStatus.Success)
            {
                Response.Write("登陆成功");
            }
            else
            {
                Response.Write("登陆失败");
            }
        }

        protected void btnRegister_Click(object sender, EventArgs e)
        {
            var result = CommonService.GetChinaerService.RegisterAdministrator(new DTO.AdministratorDTO()
            {
                LoginName = this.txtName.Text,
                LoginPassword = this.txtPassword.Text.Trim()
            });
            if (result.Success == true)
            {
                Response.Write("注册成功");

            }
            else
            {
                Response.Write("注册失败");
            }
        }
    }
}